<?php
/**
 * Created by PhpStorm.
 * User: xiangfeng
 * Date: 2022/4/8
 * Time: 9:13 AM
 */

namespace app\index\controller;


class Html extends Base
{
    public function doLogin()
    {
        $param = $this->app->request->param();
        if (empty($param['uname']) || empty($param['upass'])) {
            $this->error('参数缺失','{-null-}',40001);
        }
        $data = [
            'user_id' => 1,
            'uname' => $param['uname'],
            'nickname' => '李星',
            'avatar' => 'https://image.eastlookfor.com/image/user/avatar/tph9rc6ltd7vm0ts.png',
            'working_unit' => '清华大学',
            'introduce' => '奋斗',
            'token' => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhdWN0aW9uLmNsb3VkaW5saW5rLmNvbSIsImF1ZCI6ImF1Y3Rpb25fYXBwX2FwaSIsImlhdCI6MTYyNjkzNzYyOCwiZXhwIjoxNjI5NTI5NjI4LCJ1aWQiOiIzMzgzIiwicmlkIjoxfQ.Zu5JF2DZ9VjAIz_q9JOVMPC53-eV7J-Qs4Ae4Czvbk0',

        ];
        $this->success('登录成功', $data);
    }

    public function doRegister()
    {
        $param = $this->app->request->param();
        $this->success('注册成功', $param);
    }
}